Image data is encoded by a codec according to a certain data compression standard, for example, Moving Picture Expert Group (MPEG) standard, and then stored in a recording medium or transmitted through a communication channel in the form of a bitstream.
A standard related to the codec provides a method of efficiently compressing an amount of information of an original image, and during a compression process, a prediction process of determining a sample value to be currently decoded by using already decoded image data is performed. Such a prediction process may include an intra prediction process where spatial prediction is performed and an inter prediction process where temporal prediction is performed. A prediction signal generated according to a result of performing prediction may be added to a residual signal such that image data is reconstructed, and such a residual signal may be obtained by inversely transforming and inversely quantizing information that is transformed and quantized.